/**
 * actions.js (c) 2021
 * Author: WUYAX
 * Version: V1.0
 * Created: 2021-06-08 14:06
 * Modified:
 * Description: actions 调用私有的mutation来实现任意vuex的修改，谨慎使用。
 */

export default {
  CHANGE_VUEX_BY_PATH({ commit, rootState }, payload) {
    commit('_MODIFY_STATE', { rootState, ...payload, mode: 'modify' })
  },
  ADD_VUEX_BY_PATH({ commit, rootState }, payload) {
    commit('_MODIFY_STATE', { rootState, ...payload, mode: 'add' })
  },
  DELETE_VUEX_BY_PATH({ commit, rootState }, payload) {
    commit('_MODIFY_STATE', { rootState, ...payload, mode: 'delete' })
  }
}
